<?php


namespace api\app\model;


use think\Model;

class GoodsModel extends Model
{
    protected $name = 'goods';

    //商品封面
    public function getImageAttr($value)
    {
        return cmf_get_image_url($value);
    }
    //商品图片
    public function getImagesAttr($value)
    {
        $images = explode(',',$value);
        $imagesVal = [];
        foreach ($images as $image) {
            $imagesVal[] = cmf_get_image_url($image);
        }
        return $imagesVal;

    }

}